// webpack配置覆盖cli3模块中webpack默认配置

// 1.对路径进行简名操作
const path = require('path');

function join(url) {
  return path.join(__dirname, url)
}
module.exports = {
  // chainWebpack: callback(config ){...}
  chainWebpack: config => {
    // config.resolve.alias.set(路径简名，文件路径).set() ... 链式调用
    config.resolve.alias
      .set('styles', join('./src/assets/fonts'))
      .set('styles', join('./src/assets/images'))
      .set('styles', join('./src/assets/styles'))
      .set('common', join('./src/components/common'))
      .set('layout', join('./src/components/layout'))
      .set('views', join('./src/views'))
      .set('store', join('./src/store'))
      .set('utils', join('./src/utils'))
  },

  // baseUrl: '/dist/',

  // 反向代理设置示例
  // devServer: {
  //   proxy: {
      // '/mcp': {
      //   target: 'https://openapi.vmall.com',
      //   changeOrigin: true,
      // }
  //   }
  // }

}